<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<body>
<script>
  const p = new Promise((resolve, reject) => {
    // resolve("成功值");
    reject("失败了");
  })
  async function main() {
    try {
      let result = await p;
      console.log(result);
    } catch (e) {
      console.log(e);  // 失败了
    }
  }
  main();
</script>
</body>
</html>